package com.mly.data.algo.designMode.State;

public class FrequentFlyer {
    CState state;
    double flyMiles;

    public FrequentFlyer(){
        state = new CNoCustomer();
        flyMiles = 0;
        setState(state);
    }
    public void setState(CState state){
        this.state = state;
    }
    public void travel(int miles){
        double bonusMiles = state.travel(miles,this);
        flyMiles = flyMiles + bonusMiles;
    }
    public void show(){
        System.out.println("flyMiles:"+flyMiles);
    }
}
